package xyz.robinbingo.leetcode.a20.b06.c10;

import java.util.stream.IntStream;

public class Solution {
    public boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        char[] chars = String.valueOf(x).toCharArray();
        int length = chars.length;
        return IntStream.range(0, length / 2).noneMatch(i -> chars[i] != chars[length - i - 1]);
    }
}